# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-fastjsonschema
pkgver=2.19.1
pkgrel=2
pkgdesc="Fast JSON schema validator"
url="https://horejsek.github.io/python-fastjsonschema/"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
checkdepends="py3-pytest py3-pytest-benchmark"
makedepends="py3-gpep517 py3-setuptools py3-wheel py3-installer"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/horejsek/python-fastjsonschema/archive/refs/tags/v$pkgver.tar.gz
	pytest8.patch
	"
builddir="$srcdir/python-fastjsonschema-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	# https://github.com/horejsek/python-fastjsonschema/issues/184
	.testenv/bin/python3 -m pytest -v \
		-k "not test_pattern_with_escape_no_warnings"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5121ccd0585ea8a78f44ceca95f3f2b5eb769ac3529998a3e54da9535bec96f7e47f1240b0eba63f6fef2dec91fa86fc6317d9da6eb54fed29076759897a42aa  py3-fastjsonschema-2.19.1.tar.gz
be180edad0bd479bab4b15dbaade4d985d99b1c14666ca1bfbbb3eebc7bdbe34518d0263fd7a45e5ff6cba629ec8652c37adf5dbbf47213ed340d476f01791da  pytest8.patch
"
